package com.webchat.rmi.act;

import com.webchat.common.bean.APIResponseBean;
import com.webchat.domain.vo.request.act.ResourceBehaviorRequestVO;
import com.webchat.rmi.interceptor.RpcRequestInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;
import java.util.Set;

@FeignClient(name = "webchat-act-service",
        contextId = "resourceBehaviorClient",
        configuration = RpcRequestInterceptor.class)
public interface IResourceBehaviorClient {


    /**
     * 资源基础互动操作
     *
     * @param resourceBehaviorRequest
     * @return
     */
    @PostMapping("/act-service/resource/behavior")
    APIResponseBean<Long> behavior(@RequestBody ResourceBehaviorRequestVO resourceBehaviorRequest);

    /**
     * 取消资源基础互动操作
     *
     * @param resourceBehaviorRequest
     * @return
     */
    @PostMapping("/act-service/resource/behavior/cancel")
    APIResponseBean<Long> cancelBehavior(@RequestBody ResourceBehaviorRequestVO resourceBehaviorRequest);


    /**
     * 批量查询资源互动量
     *
     * @param resourceBehaviorRequest
     */
    @PostMapping("/act-service/resource/countBehavior")
    APIResponseBean<Map<Long, Long>> countBehavior(@RequestBody ResourceBehaviorRequestVO resourceBehaviorRequest);


    /**
     * 判断某个用户是否操作过
     *
     * @param resourceBehaviorRequest
     * @return
     */
    @PostMapping("/act-service/resource/isBehavior")
    APIResponseBean<Map<Long, Boolean>> isBehavior(@RequestBody ResourceBehaviorRequestVO resourceBehaviorRequest);

    /**
     * 批量查询一组资源下的互动人员列表
     *
     * @param resourceBehaviorRequest
     * @return
     */
    @PostMapping("/act-service/resource/listBehaviorUsers")
    APIResponseBean<Map<String, Set<String>>> listBehaviorUsers(@RequestBody ResourceBehaviorRequestVO resourceBehaviorRequest);

}
